package com.util;

import java.net.Socket;

/**
 * 检测端口是否启用
 * true已打开
 */
public class PortUtil {
    public static boolean checkPortIsOpen(int port)
    {
        try{
            Socket client = new Socket("127.0.0.1", port);
            client.close();
            return true;
        }catch(Exception e){
           return false;
        }
    }
}
